package com.xxd.rpt2.Entity

import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import org.hibernate.mapping.Join

import javax.persistence.Entity
import javax.persistence.GeneratedValue
import javax.persistence.Id
import javax.persistence.JoinColumn
import javax.persistence.OneToMany
import javax.persistence.OneToOne
import javax.persistence.Table

/**
 * @Author XuXd
 * @Description: 用户部门
 * @CreateDate: 14:03 2019-09-11
 * @Modified by: *
 */
@Entity
@Table(name="rpt2_department")
@JsonIgnoreProperties(value = [ "hibernateLazyInitializer", "handler" ])
class Department {
    @Id
    @GeneratedValue
    int id
    String name
    String code
    @OneToOne
    @JoinColumn(name="parent_id",referencedColumnName = "id",nullable = true)
    Department parentDepartment

}
